<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\Attractions\AttractionManagement\Request\Attraction_spot;

use Hyperf\Validation\Request\FormRequest;

/**
 * 点位表验证数据类
 */
class AttractionSpotRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            //点位类型Id 验证
            'type_id' => 'required',
            //点位介绍标题 验证
            'intro_title' => 'required',
            //所属景区Id 验证
            'attraction_id' => 'required',
            //显示类型1:管理端显示2:管理游客双端显示 验证
            'show_type' => 'required',
            //点位状态1:禁用2:正常 验证
            'status' => 'required',
            //点位排序 验证
            'sort' => 'required',

        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => 'id',
            'name' => '点位名称',
            'type_id' => '点位类型Id',
            'intro_title' => '点位介绍标题',
            'attraction_id' => '所属景区Id',
            'show_type' => '显示类型1:管理端显示2:管理游客双端显示',
            'status' => '点位状态1:禁用2:正常',
            'sort' => '点位排序',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填id',
            'name.required' => '必填点位名称',
            'type_id.required' => '必填点位类型Id',
            'intro_title.required' => '必填点位介绍标题',
            'attraction_id.required' => '必填所属景区Id',
            'show_type.required' => '必填显示类型1:管理端显示2:管理游客双端显示',
            'status.required' => '必填点位状态1:禁用2:正常',
            'sort.required' => '必填点位排序',

    ];
}
}